<template>
  <div class="nav-hot">
    <div class="nav-hot-bg">
      <!-- 两端对齐 -->
      <div class="nav-title-row">
        <div class="">
          <label class="label">{{title}}</label>
        </div>
        <a href="/hot_new_goods/2" class="more">
          {{moreText}}
          <van-icon name="arrow"/>
        </a>
      </div>
    </div>
    <div class="nav-hot-list">
      <a :href="'detail/'+item.id" class="item" v-for="(item,index) in list" :key="item.id+index">
        <div class="pictrue">
          <img :src="item.image">
        </div>
        <div class="name line1">{{item.storeName}}</div>
        <div class="money font-color-red">
          ￥
          <span class="num">{{item.price}}</span>
        </div>
      </a>
    </div>
  </div>
</template>

<script>
export default {
  name: "ProductCard",
  props: {
    type: {
      type: String
    },
    title: {
      type: String,
      default: ""
    },
    subTitle: {
      type: String,
      default: ""
    },
    moreText: {
      type: String,
      default: "更多"
    },
    onMore: {
      type: Function,
      default: function() {}
    },
    list: {
      type: Array
    }
  },
  methods: {
    addCart(id) {
      console.log("id", id);
    }
  }
};
</script>

<style lang="less">
.nav-hot {
  .nav-hot-bg {
    background: url("/index-bg.png");
    height: 2.15rem;
    background-repeat: no-repeat;
    background-size: 100% 100%;
    padding: 0 0.3rem;
    font-size: 0.24rem;
    color: #fff;
    margin-top: 0.15rem;
    .nav-title-row {
      height: 0.5rem;
      .more {
        font-size: 0.4rem;
      }
    }
  }
  .nav-hot-list {
    width: 9.5rem;
    height: 4.8rem;
    border-radius: 0.2rem;
    background-color: #fff;
    margin: -1.08rem auto 0 auto;
    padding: 0 0.12rem;
    -webkit-box-shadow: 0 0 0.2rem -0.1rem #aaa;
    box-shadow: 0 0 0.2rem -0.1rem #aaa;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    .item {
      :first {
        margin-left: 0;
      }
      margin-left: 0.03rem;
      width: 3.05rem;
      .pictrue {
        width: 100%;
        height: 3.2rem;
        position: relative;
        img {
          width: 100%;
          height: 100%;
          border-radius: 0.1rem;
        }
      }
      .name.line1 {
        font-size: 0.26rem;
        color: #282828;
        margin-top: 0.12rem;
      }
      .font-color-red {
        color: #73cbb6 !important;
      }
      .money {
        font-size: 15px;
        font-weight: 700;
        margin-top: 4px;
      }
    }
  }
}
</style>
